package com.gexin.model.activity;

import com.gexin.model.activity.base.BaseProductIntegralRule;

import java.util.Date;
import java.util.List;

/**
 * 业务名称:  t_product_integral_rule() 
 */
@SuppressWarnings("serial")
public class ProductIntegralRule extends BaseProductIntegralRule<ProductIntegralRule> {
	public static final ProductIntegralRule dao = new ProductIntegralRule();

	public List<ProductIntegralRule> getproductIntegralList(){
		List<ProductIntegralRule> all = dao.findAll();
		return all;
	}

	public Boolean deleteproductIntegralList(String id){
		return ProductIntegralRule.dao.deleteById(id);
	}

	public Boolean insertproductIntegralRule(Integer product_id,Integer integral_increment){
		ProductIntegralRule productIntegralRule = new ProductIntegralRule();
		productIntegralRule.setProductId(String.valueOf(product_id));
		productIntegralRule.setIntegralIncrement(integral_increment);
		long time = new Date().getTime();
		productIntegralRule.setCreateTime(time);
		productIntegralRule.setUpdateTime(time);
		Boolean flag = false;
		flag = productIntegralRule.save();
		return flag;
	};
}
